<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 	JavaScript循环创建a标签，点击触发弹出序号
        window.onload = function () {
            for (let i = 0; i < 10; i++) {
                let a = document.createElement('a');
                a.innerHTML = i;
                a.onclick = () => {
                    alert(i)
                }
                document.body.appendChild(a)
            }
        }
    </script>
</body>

</html>